package com.hl.service.serviceImpl;

import com.hl.domain.Heartessay;
import com.hl.mapper.HeartessayMapper;
import com.hl.service.HeartEssayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HeartEssayImpl implements HeartEssayService {
    @Autowired
    private HeartessayMapper heartessayMapper;
    @Override
    public List<Heartessay> selectAllEssay() {
        return heartessayMapper.selectAll();
    }

    @Override
    public Heartessay selectByIdEssay(Long id) {
        return heartessayMapper.selectByPrimaryKey(id);
    }


    @Override
    public List<Heartessay> selectLikeByEssay(String title) {
        return heartessayMapper.selectLikeByEssay(title);
    }

    @Override
    public int insert(Heartessay heartessay) {
        return heartessayMapper.insert(heartessay);
    }

    @Override
    public int update(Heartessay heartessay) {
        return heartessayMapper.updateByPrimaryKey(heartessay);
    }

    @Override
    public int delete(Long id) {
        return heartessayMapper.deleteByPrimaryKey(id);
    }
}
